//======================================================
//==                  Motor programer                ===
//======================================================
//MOTOR(int (+/-)Left_PWM,int (+/-)Right_PWM)
//‘+’电机正转；‘—’电机反转
//PWM:范围0~255
//======================================================
 void Motor(int Left_PWM,int Right_PWM)
 {
   Left_PWM = constrain(Left_PWM, -255, 255);
   Right_PWM = constrain(Right_PWM, -255, 255);
   if(Left_PWM != 0)
    {
      if(Left_PWM>0)
      {
        analogWrite(M_left1,Left_PWM);
        digitalWrite(M_left2,LOW);
      }
      else
      {
        digitalWrite(M_left1,LOW);
        analogWrite(M_left2,-Left_PWM);
      }
    }
    else
    {
        digitalWrite(M_left1,LOW);
        digitalWrite(M_left2,LOW);
    }
    if(Right_PWM != 0)
    {
      if(Right_PWM>0)
      {
        analogWrite(M_right1,Right_PWM);
        digitalWrite(M_right2, LOW);
      }
      else
      {
        digitalWrite(M_right1, LOW);
        analogWrite(M_right2, -Right_PWM);
      }
    }
    else
      {
        digitalWrite(M_right1, LOW);
        digitalWrite(M_right2, LOW);
      }
 }
